package io.renren.modules.business.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import io.renren.common.utils.Query;
import io.renren.modules.business.dao.EDailyPaperDao;
import io.renren.modules.business.entity.EDailyPaperEntity;
import io.renren.modules.business.service.EDailyPaperService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.Map;
import io.renren.common.utils.PageUtils;


@Service("eDailyPaperService")
public class EDailyPaperServiceImpl extends ServiceImpl<EDailyPaperDao, EDailyPaperEntity> implements EDailyPaperService {

    @Autowired
    private EDailyPaperDao eDailyPaperDao;

    @Override
    public PageUtils queryPage(Map<String, Object> params) {
        IPage<EDailyPaperEntity> page = this.page(
                new Query<EDailyPaperEntity>().getPage(params),
                new QueryWrapper<EDailyPaperEntity>()
        );

        return new PageUtils(page);
    }

    @Override
    public IPage<Map> queryDailyPaper(Integer pageNum, Integer pageSize, Long userId, Integer auditStatus, String dayId) {
        Page page = new Page<>(pageNum, pageSize);
        return eDailyPaperDao.queryDailyPaper(page, userId, auditStatus, dayId);
    }

}